﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using HZH_Controls.Controls;
using System.Reflection;

namespace HZH_Controls
{
    public static class ThemeManager
    {
        /// <summary>
        /// 是否禁用一键换肤，默认启用
        /// </summary>
        public static bool EnabledTheme { get; set; } = true;

        /// <summary>
        /// 统一设置主题
        /// </summary>
        /// <param name="theme"></param>
        public static void SetTheme(ThemeEntity theme)
        {
            _Theme = theme;
            if (EnabledTheme)
            {
                ThemeChanged?.Invoke(theme);
            }
        }
        private static ThemeEntity _Theme { get; set; }
        /// <summary>
        /// 当前主题
        /// </summary>
        public static ThemeEntity Theme
        {
            get { return _Theme; }
        }
        public static event Func<ThemeEntity, bool> ThemeChanged;
    }

    public class ThemeEntity
    {
        /// <summary>
        /// 边框颜色
        /// </summary>
        public Color RectColor { get; set; }
        /// <summary>
        /// 填充颜色
        /// </summary>
        public Color FillColor { get; set; }
        /// <summary>
        /// 背景色
        /// </summary>
        public Color BackColor { get; set; }
        /// <summary>
        /// 前景色
        /// </summary>
        public Color ForeColor { get; set; }
    }
}
